package git.soulbgm.common;

import git.soulbgm.common.future.SyncFuture;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2019-04-02 13:30
 * @description
 */
public class SyncFutureMap {

    private static ConcurrentHashMap<String, SyncFuture<?>> futureMap = new ConcurrentHashMap<>();

    public static <T> SyncFuture<T> get(String msgId) {
        return (SyncFuture<T>) futureMap.get(msgId);
    }

    public static <T> void set(String msgId, SyncFuture<T> syncFuture) {
        futureMap.put(msgId, syncFuture);
    }

}
